import initServerInstance from '../server/initServerInstance';

if (require.main === module) {
	(async () => {
		const server = await initServerInstance({
			loggerConfig: {
				name: 'upgrade',
				alwaysCreate: true,
			},
		});
		const {
			app: { model },
		} = server;
		const { Job } = model;

		await Job.updateMany(
			{ 'vulSettings.depth': null },
			{ $set: { 'vulSettings.depth': 10 } }
		);
		await Job.updateMany(
			{ 'securityEventSettings.depth': null },
			{ $set: { 'securityEventSettings.depth': 10 } }
		);

		process.exit();
	})();
}
